package cn.jbit;


import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;


@SpringBootApplication
@Data
//@NacosPropertySource(dataId = "order-service", autoRefreshed = true)
//@EnableDiscoveryClient
@EnableDiscoveryClient
public class OrderserviceApplication{


    public static void main(String[] args) {
        SpringApplication.run(OrderserviceApplication.class, args);
    }


//    @NacosInjected
//    private NamingService namingService;

    @Value("${spring.application.name}")
    private String applicationName;

    @Value("${server.port}")
    private  Integer port;

//    @NacosValue(value = "${service.name:hah}", autoRefreshed = true)
//    private String name;

//    @RequestMapping(value = "/get", method= RequestMethod.GET)
//    @ResponseBody
//    public String get() {
//        System.out.println(name);
//        return name;
//    }
//    @RequestMapping(value = "/get1", method= RequestMethod.GET)
//    @ResponseBody
//    public List<Instance> getService(@RequestParam String serviceName) throws NacosException {
//        return namingService.getAllInstances(serviceName);
//    }



    /*@Override
    public void run(String... args) throws Exception {
        namingService.registerInstance(applicationName,"192.168.43.66",port);
    }*/
}
